package com.iotechn.unimall.app.api.running;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.iotechn.unimall.core.Const;
import com.iotechn.unimall.core.annotation.HttpMethod;
import com.iotechn.unimall.core.annotation.HttpOpenApi;
import com.iotechn.unimall.core.annotation.HttpParam;
import com.iotechn.unimall.core.annotation.HttpParamType;
import com.iotechn.unimall.core.annotation.param.NotNull;
import com.iotechn.unimall.core.exception.ServiceException;
import com.iotechn.unimall.data.domain.RunningGroupUserDO;
import com.iotechn.unimall.data.domain.UserDO;
import com.iotechn.unimall.data.dto.UserDTO;

import java.util.List;

/**
 * Created by rize on 2019/6/30.
 */
@HttpOpenApi(group = "running.user", description = "跑步-用户服务")
public interface RunningUserService {


    @HttpMethod(description = "第三方登录")
    public UserDTO thirdPartLogin(
            @NotNull @HttpParam(name = "loginType", type = HttpParamType.COMMON, description = "第三方代号") Integer loginType,
            @NotNull @HttpParam(name = "ip", type = HttpParamType.IP, description = "用户Ip") String ip,
            @NotNull @HttpParam(name = "raw", type = HttpParamType.COMMON, description = "第三方平台返回的数据") String raw) throws ServiceException;

    @HttpMethod(description = "同步用户信息")
    public String syncUserInfo(
            @HttpParam(name = "nickName", type = HttpParamType.COMMON, description = "用户昵称") String nickName,
            @HttpParam(name = "nickname", type = HttpParamType.COMMON, description = "用户昵称") String nickname,
            @HttpParam(name = "avatarUrl", type = HttpParamType.COMMON, description = "用户头像url") String avatarUrl,
            @HttpParam(name = "gender", type = HttpParamType.COMMON, description = "性别0未知1男2女") Integer gender,
            @HttpParam(name = "birthday", type = HttpParamType.COMMON, description = "用户生日") Long birthday,
            @HttpParam(name = Const.USER_ACCESS_TOKEN, type = HttpParamType.HEADER, description = "访问令牌") String accessToken,
            @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "用户ID") Long userId) throws ServiceException;

    @HttpMethod(description = "获取用户信息")
    public UserDTO getUserInfo(@NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "用户ID") Long userId) throws ServiceException;

    @HttpMethod(description = "获取H5签名")
    public Object getH5Sign(
            @NotNull @HttpParam(name = "url", type = HttpParamType.COMMON, description = "url") String url) throws ServiceException;

    @HttpMethod(description = "管理员列表")
    Page<UserDTO> selectAdminPage(@NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "用户Id") Long userId,
                                  @HttpParam(name = "pageNo", valueDef = "1", type = HttpParamType.COMMON, description = "分页查询偏移量") Integer pageNo,
                                  @HttpParam(name = "pageSize", valueDef = "10", type = HttpParamType.COMMON, description = "分页查询长度") Integer pageSize);


    @HttpMethod(description = "取消管理员资格")
    public Boolean cancelAdmin(
            @NotNull @HttpParam(name = "recordId", type = HttpParamType.COMMON, description = "记录id") Long recordId,
            @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "用户ID") Long userId) throws ServiceException;


    @HttpMethod(description = "删除未提交打卡记录人员")
    public Boolean deleteUser(@NotNull @HttpParam(name = "recordId", type = HttpParamType.COMMON, description = "记录id") Long recordId, @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "用户id") Long userId) throws ServiceException;


    @HttpMethod(description = "当月未打卡人员列表")
    public Page<UserDO> selectUncommitUser(@NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "用户id") Long userId,
                                           @HttpParam(name = "pageNo", valueDef = "1", type = HttpParamType.COMMON, description = "分页查询偏移量") Integer pageNo,
                                           @HttpParam(name = "pageSize", valueDef = "10", type = HttpParamType.COMMON, description = "分页查询长度") Integer pageSize);

    @HttpMethod(description = "获取当前用户拥有的跑团")
    public List<RunningGroupUserDO> getUserGroup(@NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "用户id") Long userId);

    @HttpMethod(description = "退出跑团")
    public Boolean removeUserGroup(@NotNull @HttpParam(name = "runningGroupId", type = HttpParamType.COMMON, description = "跑团id") Long runningGroupId, @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "用户id") Long userId) throws ServiceException;

    @HttpMethod(description = "设置为当前跑团")
    public Boolean setCurrentUserGroup(@NotNull @HttpParam(name = "runningGroupId", type = HttpParamType.COMMON, description = "跑团id") Long runningGroupId, @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "用户id") Long userId) throws ServiceException;


}
